load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")

go_library(
    name = "rowexec",
    srcs = [
        "aggregator.go",
        "bulk_row_writer.go",
        "columnbackfiller.go",
        "countrows.go",
        "distinct.go",
        "filterer.go",
        "hashgroupjoiner.go",
        "hashjoiner.go",
        "indexbackfiller.go",
        "inverted_expr_evaluator.go",
        "inverted_filterer.go",
        "inverted_joiner.go",
        "joinerbase.go",
        "joinreader.go",
        "joinreader_span_generator.go",
        "joinreader_strategies.go",
        "mergejoiner.go",
        "noop.go",
        "ordinality.go",
        "processors.go",
        "project_set.go",
        "rowfetcher.go",
        "sample_aggregator.go",
        "sampler.go",
        "sorter.go",
        "stats.go",
        "stream_group_accumulator.go",
        "stream_merger.go",
        "subquery.go",
        "tablereader.go",
        "values.go",
        "windower.go",
        "zigzagjoiner.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/rowexec",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/kvstreamer",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/roachpb",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/sql/backfill",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execagg",
        "//pkg/sql/execinfra/execopnode",
        "//pkg/sql/execinfra/execreleasable",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/execstats",
        "//pkg/sql/inverted",
        "//pkg/sql/isql",
        "//pkg/sql/memsize",
        "//pkg/sql/opt/invertedexpr",
        "//pkg/sql/opt/invertedidx",
        "//pkg/sql/parser",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/row",
        "//pkg/sql/rowcontainer",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowinfra",
        "//pkg/sql/scrub",
        "//pkg/sql/sem/builtins",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/tree/treecmp",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/span",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/sqltelemetry",
        "//pkg/sql/stats",
        "//pkg/sql/types",
        "//pkg/util",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/cancelchecker",
        "//pkg/util/ctxgroup",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/intsets",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "//pkg/util/optional",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/stringarena",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/tracing/tracingpb",
        "@com_github_axiomhq_hyperloglog//:hyperloglog",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "rowexec_test",
    size = "medium",
    srcs = [
        "aggregator_test.go",
        "backfiller_test.go",
        "distinct_test.go",
        "filterer_test.go",
        "hashjoiner_test.go",
        "inverted_expr_evaluator_test.go",
        "inverted_filterer_test.go",
        "inverted_joiner_test.go",
        "joinreader_blackbox_test.go",
        "joinreader_test.go",
        "main_test.go",
        "mergejoiner_test.go",
        "noop_test.go",
        "ordinality_test.go",
        "processor_utils_test.go",
        "processors_test.go",
        "project_set_test.go",
        "sample_aggregator_test.go",
        "sampler_test.go",
        "set_op_test.go",
        "sorter_test.go",
        "stats_test.go",
        "tablereader_test.go",
        "utils_test.go",
        "values_test.go",
        "windower_test.go",
        "zigzagjoiner_test.go",
    ],
    embed = [":rowexec"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "large"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    deps = [
        "//pkg/base",
        "//pkg/gossip",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/rangecache",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/backfill",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/flowinfra",
        "//pkg/sql/inverted",
        "//pkg/sql/isql",
        "//pkg/sql/opt/invertedexpr",
        "//pkg/sql/randgen",
        "//pkg/sql/rowcontainer",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/span",
        "//pkg/sql/stats",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/testutils",
        "//pkg/testutils/distsqlutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/intsets",
        "//pkg/util/json",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/tracing/tracingpb",
        "@com_github_axiomhq_hyperloglog//:hyperloglog",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//types",
        "@com_github_jackc_pgx_v4//:pgx",
        "@com_github_stretchr_testify//require",
    ],
)

disallowed_imports_test(
    "rowexec",
    [
        "//pkg/sql/colexec",
        "//pkg/sql/colflow",
        "//pkg/sql/rowflow",
    ],
)
